<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网格布局</title>
    <style>
        body {
            width: 90%;
            max-width: 900px;
            margin: 2em auto;
            font: .9em/1.2 Arial, Helvetica, sans-serif;
        }

        .container>div {
            border-radius: 5px;
            padding: 10px;
            background-color: rgba(51, 51, 51, 0.377);
            border: 1px solid rgb(196, 64, 3);
        }

        .container {
            display: grid;
            /* grid-template-columns: 200px 200px 200px; */
            /* grid-template-columns: 2fr 1fr 1fr; */
            /* grid-template-columns: repeat(3, 1fr); */
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            /* grid-gap: 20px; */
            grid-column-gap: 15px;
            /* grid-auto-rows: 100px; */
            grid-auto-rows: 100px;
            grid-auto-rows: minmax(100px, auto);
            grid-row-gap: 10px;
        }

    </style>
</head>

<body>
    <div class="container">
        <div>One</div>
        <div>Two</div>
        <div>Three</div>
        <div>Four</div>
        <div>Five</div>
        <div>Six</div>
        <div>Seven</div>
    </div>
</body>

</html>
